]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell/app: Honor XDG SingleMainWindow key
authorNate Graham <nate@kde.org>
Wed, 5 Jan 2022 16:13:12 +0000 (09:13 -0700)
committerMarge Bot <marge-bot@gnome.org>
Wed, 5 Jan 2022 18:14:09 +0000 (18:14 +0000)
This is the upstreamed version of X-GNOME-SingleWindow which is now a
part of the XDG desktop file spec as of version 1.5; see
https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/53

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2084>

src/shell-app.c

index 587b4a4edb32a85f11b2ab3698ca4fcc50cb1507..a3215db59ed4f640769bb1094fb6704df26cf50c 100644 (file)
@@ -661,7 +661,16 @@ shell_app_can_open_new_window (ShellApp *app)
 
   desktop_info = G_DESKTOP_APP_INFO (app->info);
 
-  /* If the app is explicitly telling us, then we know for sure */
+  /* If the app is explicitly telling us via its desktop file, then we know
+   * for sure
+  */
+  if (g_desktop_app_info_has_key (desktop_info, "SingleMainWindow"))
+      return !g_desktop_app_info_get_boolean (desktop_info,
+                                              "SingleMainWindow");
+
+  /* GNOME-specific key, for backwards compatibility with apps that haven't
+   * started using the XDG "SingleMainWindow" key yet
+  */
   if (g_desktop_app_info_has_key (desktop_info, "X-GNOME-SingleWindow"))
     return !g_desktop_app_info_get_boolean (desktop_info,
                                             "X-GNOME-SingleWindow");